<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0"
	prefix="dsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fn" prefix="fn"%>
<%@ page isELIgnored="false"%>
<dsp:page>
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf"%>

<dsp:importbean bean="/atg/dynamo/droplet/ForEach" />
<dsp:importbean bean="/atg/commerce/catalog/CategoryLookup" />
<dsp:importbean bean="/atg/commerce/pricing/PriceItem" />
<dsp:importbean bean="/atg/commerce/pricing/PriceEachItem" />
<dsp:importbean bean="/atg/dynamo/droplet/Switch"/>
<dsp:importbean bean="/atg/commerce/catalog/CatalogNavHistoryCollector"/>


<title>Product List</title>
	</head>
	<body>
		<div id="wrap" class="clear-block">
			<div id="header">
				<dsp:include page="header.jsp" />
			</div>
			<div id="mainnav">
				<dsp:include page="categoryBar.jsp" />
			</div>
			<div id="main">
				<div class="breadcrumb">
					<dsp:droplet name="CategoryLookup">
							<dsp:param name="id" param="id" />
							<dsp:param name="elementName" value="category" />
							<dsp:oparam name="output">
						
								<dsp:droplet name="ForEach">
									<dsp:param name="array" param="parentCategoryForCatalog" />
									<dsp:param name="ppp" param="parentCategory"/>
									<dsp:param name="ccc" param="category" />
									  <dsp:a href="index.jsp">Home</dsp:a> <span class="cutline">&raquo;</span>
										<span class="cutline">
											<dsp:a href="category.jsp">
												<dsp:param name="id" param="category.parentCategory.id"/>
												<dsp:valueof param="category.parentCategory.displayName" />&nbsp;&nbsp;
											</dsp:a> &raquo;											
										</span>
										<span class="green"> 
											<dsp:valueof param="category.displayName" /></span>
								</dsp:droplet>	
							</dsp:oparam>
					</dsp:droplet>
					
				</div>
			
				<div class="prodlist">
					<dsp:droplet name="CategoryLookup">
						<dsp:param name="id" param="id" />
						<dsp:param name="elementName" value="subCategory" />
						<dsp:oparam name="output">
							<dsp:droplet name="ForEach">
								<dsp:param name="array" param="subCategory.childProducts" />
								<dsp:param name="elementName" value="product" />
								<dsp:oparam name="output">
									<div class="box">
										<div class="img">
											<dsp:a href="productDetail.jsp">
												<dsp:param name="pId" param="product.id" />
												<dsp:getvalueof var="imgUrl"
													param="product.thumbnailImage.url" />
												<img src="${fn:replace(imgUrl,'../','')}" />
											</dsp:a>
										</div>
										<div class="info">
											<p class="name">
												<dsp:a href="productDetail.jsp">
													<dsp:param name="pId" param="product.id" />
													<dsp:valueof param="product.displayName" />
												</dsp:a>
											</p>
										</div>
										<div class="price">
											<p>
												<dsp:droplet name="PriceEachItem">
													<dsp:param name="items" param="product.childSKUs" />
													<dsp:param name="elementName" value="skus" />
													<dsp:oparam name="output">
														<dsp:droplet name="ForEach">
															<dsp:param name="array" param="skus" />
															<dsp:param name="elementName" value="priceItem" />
															<dsp:oparam name="output">
																<dsp:getvalueof var="index" param="index" />
																<c:choose>
																	<c:when test="${index == 0 }">
																		<dsp:droplet name="/atg/dynamo/droplet/Switch">
																			<dsp:param name="value"
																				param="priceItem.priceInfo.onSale" />
																			<dsp:oparam name="false">
																				<span><dsp:valueof converter="currency"
																						param="priceItem.priceInfo.amount">no price</dsp:valueof></span>
																			</dsp:oparam>
																			<dsp:oparam name="true">
																				<dsp:getvalueof var="listPrice"
																					param="priceItem.priceInfo.listPrice"></dsp:getvalueof>
																				<dsp:getvalueof var="salePrice"
																					param="priceItem.priceInfo.salePrice"></dsp:getvalueof>
																				<c:choose>
																					<c:when test="${listPrice > salePrice}">
																						<span class="was"> <dsp:valueof
																								converter="currency"
																								param="priceItem.priceInfo.listPrice">no price</dsp:valueof>
																						</span>
																						<span class="now"> <dsp:valueof
																								converter="currency"
																								param="priceItem.priceInfo.salePrice">no price</dsp:valueof>
																						</span>
																					</c:when>
																					<c:when test="${listPrice eq salePrice}">
																						<span class="now"> <dsp:valueof
																								converter="currency"
																								param="priceItem.priceInfo.salePrice">no price</dsp:valueof>
																						</span>
																					</c:when>
																				</c:choose>
																			</dsp:oparam>
																		</dsp:droplet>
																	</c:when>
																</c:choose>
															</dsp:oparam>
														</dsp:droplet>
													</dsp:oparam>
												</dsp:droplet>
											</p>
										</div>
									</div>
								</dsp:oparam>
							</dsp:droplet>
						</dsp:oparam>
					</dsp:droplet>
				</div>
			</div>
			<div id="footer">
				<dsp:include page="footer.jsp" />
			</div>
		</div>
	</body>
</dsp:page>
</html>